/**
 * Created by Administrator on 2014/8/20.
 */

var wxHandler = require('./wxHandler');
var util = require('util');


var WeChatHandler = function(req,res){
    wxHandler.call(this);
    this.req = req;
    this.res = res;
};

util.inherits(WeChatHandler,wxHandler);

WeChatHandler.prototype.autoResponse = function(){
    var reqMsg = this.wxXmlRequest();
    var resMsg = JSON.parse(JSON.stringify(reqMsg));
    resMsg.FromUserName = reqMsg.ToUserName;
    resMsg.ToUserName = reqMsg.FromUserName;
    delete resMsg.MsgId;
    this.wxXmlResponse(resMsg);
};



module.exports = WeChatHandler;
